﻿using System;
using System.Data;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Data.OracleClient;
using Biblioteca.DataBase;

namespace SERIX.Classes
{
    public class CHistorico
    {
        public CHistorico()
        {

        }

        static public void PreencherGrid(ref GridView tb,string camporetorno1,string camporetorno2,string tabela,string CampoFiltro, string idt)
        {
            string sql = "SELECT " + camporetorno1 + " AS Descrição, " + camporetorno2 + " AS Código FROM " + tabela + " WHERE UPPER(" + CampoFiltro + ") = '"+idt.ToUpper()+"'";
            OracleConnection conexao = new OracleConnection(ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString);
            Query qy = new Query(conexao, sql);            
            tb.DataSource = qy.ObterDataTable();           
        }
    }
}
